/*
 * Sesame Inc.
 * Copyright (c) 2009 All Rights Reserved.
 */
package com.sesame.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;
import com.sesame.service.ContactService;
import com.sesame.service.UserService;

/**
 * @author voidman
 * 
 */

public class DeleteCollectController extends AbstractController {

    private UserService userService;

    public void setUserService(UserService userService) {
        this.userService = userService;
    }

    protected ModelAndView handleRequestInternal(HttpServletRequest request,
            HttpServletResponse reponse) throws Exception {

        Integer collectId = Integer.parseInt(request.getParameter("collectId"));
        userService.deleteCollect(collectId);

        return new ModelAndView("redirect:" + request.getHeader("referer"));

    }

}